/*
2021-8-4
https://www.acwing.com/problem/content/102/
*/
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;
typedef long long ll;
const int N=1e5+5;

int a[N],b[N];

int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        b[i]=a[i]-a[i-1];
    }
    
    ll cnt1=0,cnt2=0;
    
    for(int i=2;i<=n;i++)
    {
        if(b[i]>0) cnt1+=b[i];
        else cnt2-=b[i];
    }
    
    cout<<max(cnt1,cnt2)<<endl;
    cout<<abs(cnt1-cnt2)+1<<endl;
    
    return 0;
} 
